package cn.edu.sasu.mapper;

import cn.edu.sasu.domain.entity.SysUser;
import cn.edu.sasu.domain.vo.SysUserInfoVO;
import cn.edu.sasu.domain.vo.SysUserVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {
    SysUser findSysUserByUsername(String username);
    SysUser findSysUserByUserId(Integer userId);
    Integer updatePassword(@Param("userId") Integer userId,@Param("newPassword") String newPassword);

    List<SysUserVO> findSysUserList(@Param("deleteFlag") Integer deleteFlag, @Param("offset") Integer offset, @Param("rows") Integer rows);

    Integer countSysUser(Integer deleteFlagYes);

    Integer updateSysUserDeleteFlagByUserId(@Param("userId") Integer userId,@Param("deleteFlagYes") Integer deleteFlagYes);

    Integer updateSysUserDeleteFlagByUserIds(@Param("userIds") List<Integer> userIds,@Param("deleteFlagYes")  Integer deleteFlagYes);

    List<SysUserVO> searchSysUserList(@Param("deleteFlag") Integer deleteFlag, @Param("offset") Integer offset, @Param("rows") Integer rows,@Param("username")  String username);

    Integer countSearchSysUser(@Param("deleteFlagYes") Integer deleteFlagYes,@Param("username") String username);

    Integer save(SysUser sysUser);

    Integer updateInfo(SysUserInfoVO sysUserInfoVO);
}
